package simplefactory;

/**
 * @ClassName TeaFactory
 * @Description
 * @Author yuhang11
 * @Date 2022/1/10 3:37 下午
 * @Version 1.0
 */
public class TeaFactory {

    public ITea createTea(String type){
        ITea tea = null;
        if (type.equals("longjing")){
            tea = new LongjingTea();
        }else if (type.equals("biluochun")){
            tea = new BiluochunTea();
        }
        if (tea!=null){
            tea.makeTea();
        }
        return tea;
    }
}
